package org.web.datajpa.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.web.datajpa.service.StudentService;

@Controller
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    // 返回学生列表界面
    @GetMapping("/list")
    public String getList() {
        return "/student/list";
    }

    @GetMapping("/manage")
    public String getManage() {
        return "/student/manage";
    }
//    // 原
//    @GetMapping("/list")
//    public String getList(Model model) {
//        List<Student> students = studentService.findAll();
//        model.addAttribute("students", students);
//        return "/student/list";
//    }
}
